package shuzuzuoye7;
import java.util.Scanner;
public class number {
    public static void main(String[] args) {
        int a[]=new int[100];
        System.out.println("请输入所需的数字个数：");
        Scanner sc=new Scanner(System.in);
        int sum=0,num= sc.nextInt();
        System.out.println("请输入数：");
        for(int i=0;i<num; i++){
            int shu=sc.nextInt();
            sum+=shu;
            a[i]=shu;}
        int max = 0;int min=0;
        for(int i=0;i<num;i++){
                if(a[i]>a[i+1]){
                    max=a[i];
                }else
                    min=a[i];}
        System.out.printf("数据的最大值：%d",max);
        System.out.printf("数据的最小值：%d",min);
        System.out.printf("数据的和：%d",sum);
        System.out.printf("数据的平均值：%.2f",(double)sum/num);
    }
}
